package com.pl.dailycollection.study.future.qicha;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

/**
 * @ClassName ShaoShuiMain
 * @Description: TODO
 * @Author pl
 * @Date 2020/1/2
 * @Version V1.0
 **/
public class ShaoShuiMain {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        FutureTask<String> f1 = new FutureTask<String>(new XiTools());
        FutureTask<String> f2 = new FutureTask<>(new ShaoShui(f1));

        Thread thread = new Thread(f1);
        Thread thread2 = new Thread(f2);

        thread.start();
        thread2.start();
        //等待上茶
        System.out.println(f2.get());

    }
}
